/** @file               sw_charset.h
 *  @copyright          Copyright (C) 2006-2026 flyfish (tenggui_fu@126.com)
 *  @brief              This file is part of the swallow library
 *  @author             $Author: Thinkpad $
 *  @version            $Rev: 454 $
 *  @date               $Date: 2017-02-15 18:40:44 +0800 (周三, 15 2月 2017) $
 */
#ifndef __SW_CHARSET_H__
#define __SW_CHARSET_H__

#ifdef __cplusplus
extern "C" {
#endif

typedef enum _SW_CHARSET
{
    SW_CS_ASCII,
    SW_CS_ISO_8859_1,
    SW_CS_ISO_8859_2,
    SW_CS_ISO_8859_3,
    SW_CS_ISO_8859_4,
    SW_CS_ISO_8859_5,
    SW_CS_ISO_8859_6,
    SW_CS_ISO_8859_7,
    SW_CS_ISO_8859_8,
    SW_CS_ISO_8859_9,
    SW_CS_ISO_8859_10,
    SW_CS_ISO_8859_13,
    SW_CS_ISO_8859_14,
    SW_CS_ISO_8859_15,
    SW_CS_ISO_8859_16,
    SW_CS_KOI8_R,
    SW_CS_KOI8_U,
    SW_CS_KOI8_RU,
    SW_CS_CP1250,
    SW_CS_CP1251,
    SW_CS_CP1252,
    SW_CS_CP1253,
    SW_CS_CP1254,
    SW_CS_CP1255,
    SW_CS_CP1256,
    SW_CS_CP1257,
    SW_CS_CP850,
    SW_CS_CP862,
    SW_CS_CP866,
    SW_CS_CP1131,
    SW_CS_MAC_ROMAN,
    SW_CS_MAC_CENTRAL_EUROPE,
    SW_CS_MAC_ICELAND,
    SW_CS_MAC_CROATIAN,
    SW_CS_MAC_ROMANIA,
    SW_CS_MAC_CYRILLIC,
    SW_CS_MAC_UKRAINE,
    SW_CS_MAC_GREEK,
    SW_CS_MAC_TURKISH,
    SW_CS_MAC_INTOSH,
    SW_CS_MAC_HEBREW,
    SW_CS_MAC_ARABIC,
    SW_CS_GBK,
    SW_CS_GB2312,
    SW_CS_UCS2,
    SW_CS_UCS2_BE,
    SW_CS_UCS2_LE,
    SW_CS_UCS2_INTERNAL,
    SW_CS_UCS4,
    SW_CS_UCS4_BE,
    SW_CS_UCS4_LE,
    SW_CS_UCS4_INTERNAL,
    SW_CS_UTF8,
    SW_CS_INVALID = -1
}SW_CHARSET;

typedef enum _SW_LANG
{
    SW_L_EN,
    SW_L_EN_US,
    SW_L_ZH,
    SW_L_ZH_CN,
    SW_L_ZH_TW,
    SW_L_INVALID = -1
}SW_LANG;

#define SW_T(x)     SW_Translate(x)

SW_API SW_RET SW_InitCharsetAPI(SW_VOID);
SW_API SW_RET SW_RunCharsetAPI(SW_VOID);
SW_API SW_RET SW_StopCharsetAPI(SW_VOID);
SW_API SW_RET SW_ExitCharsetAPI(SW_VOID);
SW_API const SW_CHAR *SW_GetCharsetStr(SW_CHARSET charset);
SW_API SW_CHARSET SW_GetCharset(const SW_CHAR *pStr);
SW_API const SW_CHAR *SW_GetLangAbbrStr(SW_LANG lang);
SW_API const SW_CHAR *SW_GetLangFullStr(SW_LANG lang);
SW_API SW_LANG SW_GetLang(const SW_CHAR *pStr);
SW_API SW_RET SW_ConvertCharset(SW_CHARSET toCharset, SW_CHARSET fromCharset, const SW_VOID *pInStr, SW_UINT32 inStrLen, SW_VOID *pOutStr, SW_UINT32 *pOutStrLen);
SW_API SW_RET SW_SetLocale(SW_LANG lang, SW_CHARSET charset);
SW_API const SW_CHAR *SW_Translate(const SW_CHAR *pStr);
SW_API SW_RET SW_SetTransDomain(const SW_CHAR *pDomain, const SW_CHAR *pDirName);

#ifdef __cplusplus
}
#endif

#endif
